package Event.lib;


import Creature.Player;
import Event.Story;

/**
 * 扶老人起来事件
 */

public class HelpOldman extends Story {

    int random = (int) (Math.random() * 10);

    public HelpOldman(Player player) {
        super(player);

        eventName = "扶不扶";
        happenText = "这天晚上你在街上闲逛，走到了一个偏僻的路段，突然看到一个老人倒在地上，你决定";
        options = new String[]{"快步离开", "直接过去扶他", "开启手机录像走过去扶他"};
    }


    @Override
    public void eventHappen(int option) {
        switch (option) {
            case 0:
                endText = "你感到十分害怕，快步离开了";
                player.setSan(player.getSan() - 10);
                break;
            case 1:

                if (player.getPower() >= 70) {
                    endText = "你扶起了老人，正当想要离开的时候，老人拉住了你..你有口难辩，老人的家属也在这时赶来，你直接打出十八套军体拳,揍了他儿子一顿";
                    player.setMoney(player.getMoney() + random * 15);
                    player.setSan(player.getSan() + 10);
                } else {
                    endText = "你扶起了老人，正当想要离开的时候，老人拉住了你..你有口难辩，老人的家属也在这时赶来，你直接打出十八套军体拳,被他儿子揍了一顿，还赔了钱";
                    player.setMoney(player.getMoney() - random * 15);
                    player.setSan(player.getSan() - 10);
                    player.setHealth(player.getHealth() - 30);
                }

                break;
            case 2:
                endText = "你扶起了老人，正当想要离开的时候，老人拉住了你..,但你这次留了证据";
                player.setSan(player.getSan() + 20);
                break;
        }
    }

    @Override
    public boolean canHappen(Player player) {
        return true;
    }
}



